export function getPage(page, count) {
  //定义方法
  let c = 0
  if (page != 1) {
    c = (page - 1) * count
  }
  return c
}

export function setDate(time) {
  time = time ? time : new Date()
  let DateObj = new Date(time)
  // 将时间转换为 XX年XX月XX日XX时XX分XX秒格式
  let year = DateObj.getFullYear()
  let month = DateObj.getMonth() + 1
  let day = DateObj.getDate()
  let hh = DateObj.getHours()
  let mm = DateObj.getMinutes()
  let ss = DateObj.getSeconds()
  month = month > 9 ? month : '0' + month
  day = day > 9 ? day : '0' + day
  // 最终时间
  let date = `${year}-${month}-${day} ${hh}:${mm}:${ss}`
  return date
}
